home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enigma Amiga Life 109
/
EnigmaAmiga109CD.iso
/
dalla rivista
/
amiga.free
/
sorgenti vari
/
wolfedit2 2.0.4 source.sit
/
WolfEdit2 2.0.4 Source
/
UMapDoc.p
< prev
next >
Wrap
Text File
|
1994-11-11
|
1KB
|
62 lines
unit UMapDoc;
interface
uses
UGoof;
type
IndexEntry = record
resource: LevelHandle;
map: TMap;
end;
IndexHandle = ^IndexPtr;
IndexPtr = ^IndexEntries;
IndexEntries = array[1..9999] of IndexEntry;
TMapListDoc = object(TDocument)
fNumLevels: integer;
fIndex: IndexHandle;
procedure IMapListDoc;
procedure Free;
override;
end;
TMap = object(TObject)
fMapList: TMapListDoc;
fLevelNumber: integer;
fChanged: boolean;
fCells: packed array[0..63, 0..63] of 0..255;
procedure IMap (itsMapList: TMapListDoc; itsLevelNumber: integer);
procedure Free;
override;
procedure LoadFromResource (h: LevelHandle);
function CreateResource: LevelHandle;
function MakeOwnView: TView;
end;
implementation
procedure TMapListDoc.IMapListDoc;
begin
IDocument;
fNumLevels := 0;
fIndex := IndexHandle(NewHandle(0));
end;
procedure TMapListDoc.Free;
var
i: integer;
h: Handle;
begin
for i := 1 to fNumLevels do begin
FreeObject(fIndex^^[i].map);
h := fIndex^^[i].resource;
if h <> nil then
DisposHandle(h);
end;
DisposHandle(Handle(fIndex));
end;
end.